#include "rcqtreeview.h"
#include <QMouseEvent>

RCQTreeView::RCQTreeView(QWidget *parent) :
    QTreeView(parent)
{
    installEventFilter(this);
}

bool RCQTreeView::eventFilter(QObject *obj, QEvent *event)
{
    if(event->type() == QEvent::ContextMenu)
    {
        QMouseEvent *mouseEvent = static_cast<QMouseEvent*> (event);
        send_rightButtonClicked(mouseEvent->globalPos());
        return false;
    }
    else
        return QTreeView::eventFilter(obj, event);
}
